<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function(){
	 $('#user_index_regForm input').bind("keyup",function(event){
	     if(event.keyCode==13){
	            regUser();
	        }	  
	  });
});


 function regUser(){
       $('#user_index_regForm').form('submit',{
		    url:'${pageContext.request.contextPath}/userAction!reg.action',
		    success:function(data){
			    var json=jQuery.parseJSON(data);
	            if(json.success){
			        $('#user_index_regDialog').dialog('close');
			      }
			    $.messager.show({
			         title:'提示',
			         msg:json.msg
			      });
		      }
 		   });			
      }
</script>
<div id="user_index_regDialog" style="width:250px" class="easyui-dialog" data-options="
          title:'注册',
	      modal:true,
	      closable:true,
	      closed:true,
	      buttons:[{
					text:'注册',
					iconCls:'icon-edit',
					handler:function(){
					  regUser(); 
					}
				}]
  ">
  <form id="user_index_regForm">
      <table>
        <tr>
          <th>用户名</th>
          <th> <input name="name" class="easyui-validatebox" data-options="required:true, missingMessage:'用户名必填项'"/> </th>
        </tr>
        <tr>
          <th>密码</th>
          <th> <input name="pwd" type="password" class="easyui-validatebox" data-options="required:true, missingMessage:'密码不能为空'"/> </th>
        </tr>
        <tr>
          <th>重复密码</th>
          <th> <input name="repwd" type="password" class="easyui-validatebox" data-options="required:true, missingMessage:'重复密码',validateType:'' "/> </th>
        </tr>
     </table>
  
  </form>


<div>